import request from '@/utils/request'

export function getDepts() {
  return request({
    method: 'GET',
    url: '/company/department'
  })
}

// 获取部门负责人数据
export function getEmpSimple() {
  return request({
    url: '/sys/user/simple',
    method: 'GET'
  })
}

/**
 * 添加部门接口定义
 * @param data
 * @returns {*}
 */
export function addDepartmentApi(data) {
  return request({
    method: 'POST',
    url: '/company/department',
    data
  })
}

/**
 * 获取组织架构详情数据
 */

export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

/**
 * 更新部门数据
 */

export function updateDepart(data) {
  return request({
    method: 'put',
    url: `/company/department/${data.id}`,
    data
  })
}

/**
 * 删除部门接口
 */

export function delDepartment(id) {
  return request({
    method: 'DELETE',
    url: `/company/department/${id}`
  })
}
